// CSC23401.MooreP.#11
// 4/6/2008

#include "include.h"

DrawableObj::DrawableObj()
{
  xPosition = 0;
  yPosition = 0;
  xResolution = 0;
  yResolution = 0;
}
// return width of sprite
int DrawableObj::getXResolution()
{
    return xResolution;
}
// return height of sprite
int DrawableObj::getYResolution()
{
    return yResolution;
}
// return x coord of top left corner of sprite
int DrawableObj::getXPosition()
{
    return xPosition;
}
// return y coord of top left corner of sprite
int DrawableObj::getYPosition()
{
    return yPosition;
}
// move object amount of pixels passed along x and/or y axis
void DrawableObj::moveObject(int xPosition, int yPosition)
{
    this->xPosition += xPosition;
    this->yPosition += yPosition;
}
// sets absolute position of object on screen X, Y
void DrawableObj::setCoords(int xPosition, int yPosition)
{
    this->xPosition = xPosition;
    this->yPosition = yPosition;
}
// add images to vector of FrameContainer type.
// used for static and animated sprites
void DrawableObj::addFrames(int specificAnimation, std::string fileName, int duration, int width, int height)
{
     unsigned int lastElement;
     frameVector.push_back(new FrameContainer);
     lastElement = (frameVector.size() - 1);
     frameVector.at(lastElement)->fileName = fileName;
     frameVector.at(lastElement)->duration = duration;
     frameVector.at(lastElement)->width = width;
     frameVector.at(lastElement)->height = height;
}
void DrawableObj::printMe()
{
     for(unsigned int i = 0;i < frameVector.size();i++)
     {
         std::cout << frameVector.at(i)->fileName << std::endl;
     }
}
// return the memory address of the framevector vector of FrameContainer type
// for the draw method of Graphics to draw the images on the screen
FrameVector* DrawableObj::getFrameVector()
{
    return &frameVector;
}
